package com.lixh.sdk.base.presentation

import android.app.Presentation
import com.lixh.sdk.base.event.EventPresentSend
import com.lixh.sdk.base.event.EventRegister
import com.lixh.sdk.base.util.log
import com.lixh.sdk.base.util.serialNo


interface AnalyticsDelegate {
    fun registerEvent(presentation: Presentation, event: EventRegister)
    fun traceEvent(msg: String)
}

open class AnalyticsDelegateImpl : AnalyticsDelegate {

    override fun registerEvent(presentation: Presentation, event: EventRegister) {
        EventPresentSend.obs[presentation] = mapOf(event.name to event)
    }

    override fun traceEvent(msg: String) {
        "msg:$msg,time:${System.currentTimeMillis()},device:$serialNo".log("AnalyticsDelegateImpl")
    }
}